import requests
from NMB_API_Auto.Tools.Get_Cookies import GetData


class HTTPRequest:

    def requests_case(self, item):
        login_url = 'https://openapiv5.ketangpai.com//UserApi/login'
        login_data = {"email": "790874262@qq.com", "password": "beiaidigan123!", "remember": "0"}

        login_obj = requests.post(login_url, login_data)

        if login_obj.cookies:
            setattr(GetData, 'Cookie', login_obj.cookies)
        res_obj = requests.post(item['url'], item['data'], item['http_method'], params=getattr(GetData, 'Cookie'))
        print(res_obj)



